As this is the very first exercise in this workshop, it is relatively easy and short. Its purpose is to get used to this exercise format and, more importantly, to install all necessary packages for this course.
You can find the solutions for this exercise and all other exercises in the ./solutions folder in the repo/directory that contains the course materials. You can copy code from these exercise files by clicking on the small blue clipboard icon in the code boxes’ upper right corner.
Note: We recommend you to use the ./MY_CODE folder to store your R-script files for this course. If you do that, you have to make sure that your script uses the root directory of the course materials as working directory. You can check the current working directory with getwd() and set it with setwd() accordingly.
A presumably more elegant solution would be to use RStudio and open the tidyverse-workshop-esra-2021.Rproj to open it as a project. In this case, the path is already set.
And here comes our very first exercise:
tidyverse package.
easypackages packages, which can be installed with the command install.packages("easypackages"). After loading the package with library(easypackages) you can load and install packages with the command easypackages::packages("fancy_package_1", "fancy_package_2", ...).
And here’s another quick exercise.
R’s built-in dataset USAarrests and print it.
USAarrests directly in the console or use the print() function.
tibble and print it. Compare it to the previous output.
tibble::as_tibble() function.
dplyr::glimpse(). What do you think happens to the output?
dplyr::glimpse() in one %>%-workflow.
x %>% f(.)